module Pages.SubmissionSummary(submissionSummary) where

import Pages.Tables
import State.Database
import Text.Blaze.Html5 (Html, toHtml, h2)

-- | A table of of all the submissions, without a header
submissionTable :: [SubmissionInfo] -> Html
submissionTable = renderTable columns
    where
        columns = [("Language", show.programLanguage.submissionContent),
                   ("Submission date", show.submissionDate),
                   ("Problem id", show.submissionProblem)]

-- | Summary of all the submissions
submissionSummary :: [SubmissionInfo] -> Html
submissionSummary submissions = do
        h2 $ toHtml "Solutions submitted:"
        submissionTable submissions
